<?php
/**
 * @author spenceryg
 * @date 2022/11/25
 * @time 9:36 下午
 * @focus love & life
 */

namespace app\admin\controller\sys\validate;

class AdminUserValidate extends \think\Validate
{
    protected $rule = [
        'username' => 'require|unique:admin_user',
        'password' => 'require',
        'role' => 'require',
    ];


    protected $message = [
        'username.require' => '用户名必须',
        'username.unique' => '用户名已存在',
        'password.require' => '密码必须',
        'role.require' => '角色必须',
    ];


    protected $scene = [
        'update' => [
            'username',
            'role',
        ],
        'update_super' => [
            'username',
        ],
    ];
}
